﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="WebPortal.Login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>
        <asp:Literal runat="server" Text="<%$Resources:lang,Login_Title%>" /></title>
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/jquery.cookie.js" type="text/javascript"></script>
    <script type="text/javascript">
        self.moveTo(0, 0)
        self.resizeTo(screen.availWidth, screen.availHeight)

        $(document).ready(function () {
            var rem = $.cookie('rememberme');
            if (rem == 1) {
                $("#cbxRememberMe").attr("checked", "true");
            }
            else {
                $("#cbxRememberMe").removeAttr("checked");
            }
            $("#txtUser").val($.cookie('username'));
            $("#txtUser").focus();
        });
    </script>
</head>
<body>
    <script type="text/javascript">
        function checkError() {
            alert("<%=Login_UserOrPasswordInvalid%>");
        }

        function validate() {
            if ($("#txtUser").val() == "") {
                alert("<%= Login_UserRequired%>");
                return false;
            }
            var chx = $("#cbxRememberMe").attr("checked");
            var name = $("#txtUser").val();
            if (!chx) {
                chx = 0;
                name = "";
            }
            else {
                chx = 1;
            }
            $.cookie('rememberme', chx, { expires: 3 });
            $.cookie('username', name, { expires: 3 });
            return true;
        }
    </script>
    <form id="form1" class="form" runat="server">
    <div class="container" style="margin-top: 40px">
        <div class="row row20">
            <fieldset>
                <legend>
                    <img src="Images/logo.gif" alt="Logo" style="height: 51px; width: 212px" />
                    <img src="Images/split.png" class="pl10 pr10" />
                    <span class="logotext">
                        <asp:Literal runat="server" Text="<%$Resources:lang,Login_ProjectTitle%>" /></span></legend>
                <div class="span8">
                    <img src="Images/login_bg.jpg" alt="Logo background" />
                </div>
                <div class="span4">
                    <h4 class="hide">
                        <asp:Literal ID="Literal1" runat="server" Text="<%$Resources:lang,Login_UserLogin%>"></asp:Literal></h4>
                    <label for="txtUser">
                        <asp:Literal ID="Literal2" runat="server" Text="<%$Resources:lang,Login_UserName%>"></asp:Literal></label>
                    <asp:TextBox ID="txtUser" runat="server" placeholder="<%$Resources:lang,Login_PleaseInputUserName%>"></asp:TextBox>
                    <div style="padding-top: 5px">
                    </div>
                    <label for="txtPassword">
                        <asp:Literal ID="Literal4" runat="server" Text="<%$Resources:lang,Login_Password%>"></asp:Literal></label>
                    <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" placeholder="<%$Resources:lang,Login_PleaseInputPassword%>"></asp:TextBox>
                    <label for="ddlDomains" runat="server" id="lblDomains">
                        <asp:Literal ID="Literal3" runat="server" Text="<%$Resources:lang,Login_Domain%>"></asp:Literal></label>
                    <asp:DropDownList ID="ddlDomains" runat="server">
                    </asp:DropDownList>
                    <div>
                        <div style="padding-top: 5px">
                        </div>
                        <span>
                            <asp:CheckBox ID="cbxRememberMe" Checked="true" runat="server" /><label for="cbxRememberMe"
                                style="display: inline"><asp:Literal ID="Literal5" runat="server" Text="<%$Resources:lang,Login_RememberMe%>"></asp:Literal></label>
                            <span style="padding-left: 40px;" class="pt10">
                                <asp:Button ID="btnSubmit" runat="server" Text="<%$Resources:lang,Login_Login%>"
                                    OnClientClick="return validate();" class="btn" OnClick="btnSubmit_Click" /></span>
                        </span>
                    </div>
                </div>
            </fieldset>
        </div>
        <hr />
        <div class="well">
            <p>
                <asp:Literal ID="Literal6" runat="server" Text="<%$Resources:lang,Copyright%>"></asp:Literal>
            </p>
        </div>
    </div>
    <div class="hide">
        <asp:HiddenField ID="hidReturnUrl" runat="server" />
    </div>
    </form>
</body>
</html>
